Add history propagation#1025
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1025 +/- ##
==========================================
- Coverage 86.63% 81.88% -4.75%
==========================================
Files 84 141 +57
Lines 4473 13983 +9510
==========================================
+ Hits 3875 11450 +7575
- Misses 598 2533 +1935 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
f492eed to
4e5a9ad
Compare
Signed-off-by: Albert Callarisa <albert@diagrid.io>
4e5a9ad to
53cc107
Compare
seherv
suggested changes
May 14, 2026
Signed-off-by: Albert Callarisa <albert@diagrid.io>
seherv
approved these changes
May 15, 2026
CasperGN
approved these changes
May 15, 2026
5 tasks
5 tasks
sicoyle
pushed a commit
to GHX5T-SOL/python-sdk
that referenced
this pull request
May 26, 2026
* feat(workflow): align history propagation API with go-sdk Cassie (durabletask-go author) flagged divergence between python-sdk dapr#1025 and the freshly-renamed go-sdk helpers in durabletask-go dapr#105 (merged 2026-05-19, after dapr#1025 landed). This brings python-sdk's surface back in line for cross-SDK parity before 1.18 ships. Read API renames (mirror durabletask-go GetLast*ByName): - PropagatedHistory.get_workflow_by_name -> get_last_workflow_by_name - WorkflowResult.get_activity_by_name -> get_last_activity_by_name - WorkflowResult.get_child_workflow_by_name -> get_last_child_workflow_by_name Plural variants (get_workflows_by_name, get_activities_by_name, get_child_workflows_by_name) and the chain-level helpers are unchanged. Scheduling helpers (mirror go-sdk workflow.PropagateLineage / workflow.PropagateOwnHistory): - propagate_lineage() -> PropagationScope.LINEAGE - propagate_own_history() -> PropagationScope.OWN_HISTORY PropagationScope enum is kept as the underlying value, so both `propagation=propagate_lineage()` and `propagation=PropagationScope.LINEAGE` work. Example, README snippet, and tests updated to use the renamed/new surface. No runtime/proto changes. Refs: dapr#1001, dapr/durabletask-go#105, dapr/go-sdk#823 Signed-off-by: Nelson Parente <nelson_parente@live.com.pt> * refactor(workflow): drop propagate_lineage/propagate_own_history factories Per review feedback, Go-style factory helpers are not idiomatic Python: they obscure the actual enum value at the call site and confuse static type checkers (return annotation only shows PropagationScope, not the specific member). Use PropagationScope.LINEAGE / PropagationScope.OWN_HISTORY directly instead. Signed-off-by: Nelson Parente <nelson_parente@live.com.pt> --------- Signed-off-by: Nelson Parente <nelson_parente@live.com.pt>
sicoyle
added a commit
that referenced
this pull request
May 28, 2026
) * feat(workflow): align history propagation API with go-sdk Cassie (durabletask-go author) flagged divergence between python-sdk #1025 and the freshly-renamed go-sdk helpers in durabletask-go #105 (merged 2026-05-19, after #1025 landed). This brings python-sdk's surface back in line for cross-SDK parity before 1.18 ships. Read API renames (mirror durabletask-go GetLast*ByName): - PropagatedHistory.get_workflow_by_name -> get_last_workflow_by_name - WorkflowResult.get_activity_by_name -> get_last_activity_by_name - WorkflowResult.get_child_workflow_by_name -> get_last_child_workflow_by_name Plural variants (get_workflows_by_name, get_activities_by_name, get_child_workflows_by_name) and the chain-level helpers are unchanged. Scheduling helpers (mirror go-sdk workflow.PropagateLineage / workflow.PropagateOwnHistory): - propagate_lineage() -> PropagationScope.LINEAGE - propagate_own_history() -> PropagationScope.OWN_HISTORY PropagationScope enum is kept as the underlying value, so both `propagation=propagate_lineage()` and `propagation=PropagationScope.LINEAGE` work. Example, README snippet, and tests updated to use the renamed/new surface. No runtime/proto changes. Refs: #1001, dapr/durabletask-go#105, dapr/go-sdk#823 * refactor(workflow): drop propagate_lineage/propagate_own_history factories Per review feedback, Go-style factory helpers are not idiomatic Python: they obscure the actual enum value at the call site and confuse static type checkers (return annotation only shows PropagationScope, not the specific member). Use PropagationScope.LINEAGE / PropagationScope.OWN_HISTORY directly instead. --------- (cherry picked from commit 2fd3237) Signed-off-by: Nelson Parente <nelson_parente@live.com.pt> Signed-off-by: dapr-bot <dapr-bot@users.noreply.github.com> Co-authored-by: Nelson Parente <nelson_parente@live.com.pt> Co-authored-by: Sam <sam@diagrid.io>
nelson-parente
added a commit
to nelson-parente/quickstarts
that referenced
this pull request
May 28, 2026
Aligns the Python workflow history propagation quickstart with Cassie's canonical Go version that merged into release-1.18 (dapr#1315, tutorials/workflow/go/history-propagation). Changes to match the canonical structure: - Move from workflows/python/sdk-context-propagation/order-processor/ to tutorials/workflow/python/history-propagation/, matching the Go sibling at tutorials/workflow/go/history-propagation/ - Split the monolithic app.py into app.py / workflow.py / models.py, mirroring main.go / workflow.go / models.go - Add ForwardLineage flag to PatientRecord and run both scenarios back-to-back (happy path + negative), purging state after each so the app exits on its own - Make DispenseMedication refuse to dispense when no propagated history is received, returning a refused DispenseResult with a Reason field - Match the Go README: title, propagation-scope table, STEP markers, expected output for both scenarios - dapr.yaml: appID=patient-app (was order-processor), resourcesPath=../../resources (was ../../components), appLogDestination/daprdLogDestination=console to match sister Python tutorials and Cassie's Go example - Use correct Python SDK API names: get_last_workflow_by_name / get_last_activity_by_name (the earlier draft used get_workflow_by_name / get_activity_by_name, which were renamed in dapr/python-sdk#1025) Signed-off-by: Nelson Parente <nelson_parente@live.com.pt>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds workflow history propagation to
dapr-ext-workflow.A workflow can opt into propagating its execution history to a child workflow or activity via
propagation=PropagationScope.OWN_HISTORYorpropagation=PropagationScope.LINEAGEoncall_activity/call_child_workflow.The receiver reads the propagated chunk through
ctx.get_propagated_history()and queries it withPropagatedHistory.get_workflow_by_name(...)→WorkflowResult.get_activity_by_name(...)/.get_child_workflow_by_name(...).Public surface lives in
dapr.ext.workflow.propagationand is re-exported fromdapr.ext.workflow— users never need to import from_durabletask. Default behavior is unchanged:propagation=Nonepropagates nothing.Includes an example app at
examples/workflow/history_propagation.py.References